﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Lesson6_CallListDic : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        LuaMgr.GetInstance().Init();
        LuaMgr.GetInstance().DoLuaFile("Main");
        
        //同一类型List
        List<int> list = LuaMgr.GetInstance().Global.
            Get<List<int>>("testList");
        
        Debug.Log("____________________________");
        for (int i = 0; i < list.Count; ++i)
        {
            Debug.Log(i+"__"+list[i]);
        }
        
        List<object> list2 = LuaMgr.GetInstance().Global.
            Get<List<object>>("testList2");
        
        Debug.Log("____________________________");
        for (int i = 0; i < list2.Count; ++i)
        {
            Debug.Log(i+"__"+list2[i]);
        }
        
        Dictionary<string,int> dic= LuaMgr.GetInstance().Global.
            Get<Dictionary<string,int>>("testDic");
        Debug.Log("____________________________");
        Debug.Log(dic["one"]);
        
        Dictionary<object,object> dic2= LuaMgr.GetInstance().Global.
            Get<Dictionary<object,object>>("testDic2");
        Debug.Log("____________________________");
        foreach (var pair in dic2)
        {
            Debug.Log(pair.Key+"__"+pair.Value);
        }
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
